//
//  RightViewController.m
//  Leisure
//
//  Created by lanou on 16/6/28.
//  Copyright © 2016年 张凡. All rights reserved.
//

#import "RightViewController.h"

@interface RightViewController ()

@end

@implementation RightViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //创建barButton
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"菜单" style:UIBarButtonItemStylePlain target:self action:@selector(itemAction)];
        

}
- (void)itemAction{

    //向右偏移
    if (!self.isSlider) {
        [UIView animateWithDuration:0.2 animations:^{
            self.navigationController.view.frame = CGRectMake(kWidth/2, 0, kWidth, kHeight);
        }];
    }else{
        //回到原位
        [UIView animateWithDuration:0.2 animations:^{
            self.navigationController.view.frame = CGRectMake(0, 0, kWidth, kHeight);
        }];

    }
    self.isSlider = !self.isSlider;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
